﻿@model CultuRAM.Models.Dashboard

@*<script type="text/javascript" src="https://www.google.com/jsapi"></script>*@
@{
    ViewBag.Title = "Dashboard";
}

<hgroup class="title">
@*    <h1>@ViewBag.Title</h1>*@
    <h2>@ViewBag.Message</h2>
</hgroup>

<div class="row-fluid">
    <div class="span8" style="text-align: left; padding-left: 60px">   
        <div class="mosaic">
            <a href="@Url.Action("Index", "AccreditingRequest")" class="link">
                <img src="~/Images/Icones/icon_accreditings.png" style="width: 64px" /></a><br />
            Pedidos de Adesão
        </div>
    
        <div class="mosaic">
            <a href="@Url.Action("Index", "Entity")" class="link">
                <img src="~/Images/Icones/icon_entitys.png"style="width: 64px"/></a><br />
            Entidades
        </div>

        <div class="mosaic">
            <a href="@Url.Action("UserManager", "Account")" class="link">
                <img src="~/Images/Icones/icon_users.png" style="width: 64px"/></a><br />
            Utilizadores
        </div>
    
        <div class="mosaic">
            <a href="@Url.Action("Index", "Parameters")" class="link">
                <img src="~/Images/Icones/icon_parameters.png" style="width: 64px"/></a><br />
            Parâmetros
        </div>

        <div class="mosaic">
            <a href="@Url.Action("Index", "Event")" class="link">
                <img src="~/Images/Icones/icon_events.png" style="width: 64px" /></a><br />
            Eventos
        </div>
    
        <div class="mosaic">
            <a href="@Url.Action("IndexHl", "Event")" class="link">
                <img src="~/Images/Icones/icon_highlights.png" style="width: 64px"/></a><br />
            Eventos em Destaque
        </div>
@*        <div class="mosaic">
            <a href="@Url.Action("Index", "Parameters", new {id ="10"})" class="link">
                <img src="~/Images/Icones/icon_participants.png" style="width: 64px" /></a><br />
            Artístas
        </div>*@
@*        <div class="mosaic">
            <a href="#" class="link">
                <img src="~/Images/Icones/icon_tickets.png" style="width: 64px"/></a><br />
            Bilheteira
        </div>*@
@*        <div class="mosaic">
            <a href="#" class="link">
                <img src="~/Images/Icones/icon_alerts.png" style="width: 64px" /></a><br />
            Alertas
        </div>*@
@*        <div class="mosaic">
            <a href="@Url.Action("Index", "Event")" class="link">
                <img src="~/Images/Icones/icon_export.png" style="width: 64px"/></a><br />
            Exportação
        </div>*@
        <div class="mosaic">
            <a href="@Url.Action("Index", "Statistics")" class="link">
                <img src="~/Images/Icones/icon_statistics.png" style="width: 64px" /></a><br />
            Estatísticas
        </div>
           <div class="mosaic">
            <a href="@Url.Action("Ajuda", "Temp")" class="link">
                <img src="~/Images/Icones/icon_help.png" style="width: 64px" /></a><br />
            Ajuda
        </div>
    </div>

    <div class="span4" style="padding-right: 60px">

        <!-- Collapse
            ================================================== --> 
        <div class="accordion" id="accordion2">
            <div class="accordion-group">
                <div class="accordion-heading" >
                    <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                        <i class="icon-bell icon-white"></i> <b>Alertas</b> <span class="label label-info" style="float: right;">&nbsp; @Model.AlertList.Count &nbsp;</span>
                    </a>
                </div>
                <div id="collapseOne" class="accordion-body in collapse">
                    <div class="accordion-inner">
                        @if (@Model.AlertList.Any())
                        {
                            var firstOrDefault = Model.AlertList.FirstOrDefault();
                            
                            if (firstOrDefault != null)
                            {
                                <table id="alertList" class="table table-hover table-striped table-bordered" style="width: 100%; font-size: 12px !important;">
                                    <tr>
                                        <th>@Html.DisplayNameFor(model => firstOrDefault.Description)</th>
                                        <th>@Html.DisplayNameFor(model => firstOrDefault.Date) </th>
                                    </tr>
                                    @foreach (var item in Model.AlertList)
                                    {
                                        <tr>
                                            <td>@item.Date</td>
                                            <td>@item.Date</td>   
                                        </tr>
                                    }        
                                </table>
                            }
                        }
                        else
                        {
                            <div class="alert alert-warning">
                                @*<button type="button" class="close" data-dismiss="alert">×</button>*@
                                Não existem alertas pendentes.
                            </div>                  
                        }
                    </div>
                </div>   
            </div> 

            <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
                    <i class="icon-comment icon-white"></i> <b>Comentários Recentes</b> <span class="label label-info" style="float: right;">&nbsp; @Model.CommentList.Count &nbsp;</span>
                </a>
            </div>
            <div id="collapseTwo" class="accordion-body collapse">
                <div class="accordion-inner">
                    @if (@Model.CommentList.Any())
                    {
                        var firstOrDefault = Model.CommentList.FirstOrDefault();
                            
                        if (firstOrDefault != null)
                        {
                            <table id="newCom" class="table table-hover table-striped table-bordered" style="width: 100%; font-size: 12px !important;">
                                <tr>
                                    <th>@Html.DisplayNameFor(model => firstOrDefault.Name)</th>
                                    <th>@Html.DisplayNameFor(model => firstOrDefault.CommentText) </th>
                                </tr>
                                @foreach (var item in Model.CommentList)
                                {
                                    <tr>
                                        <td>@item.Name</td>
                                        <td>@item.CommentText</td>   
                                    </tr>
                                }        
                            </table>
                        }
                    }
                    else
                    {
                        <div class="alert alert-warning">
                            Não existem comentários.
                        </div>                  
                    }
                </div>
            </div>
        </div>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
                    <i class="icon-list-alt icon-white"></i> <b>Pedidos de Adesão</b> <span class="label label-info" style="float: right;">&nbsp; @Model.AccReqList.Count &nbsp;</span>
                </a>
            </div>
            <div id="collapseThree" class="accordion-body collapse">
                <div class="accordion-inner">
                    @if (@Model.AccReqList.Any())
                    {
                        var firstOrDefault = Model.AccReqList.FirstOrDefault();
                            
                        if (firstOrDefault != null)
                        {
                            <table id="accList" class="table table-hover table-striped table-bordered" style="width: 100%; font-size: 12px !important;">
                                <tr>
                                    <th style="width: 60%;">@Html.DisplayNameFor(model => firstOrDefault.Entity.Name)</th>
                                    <th style="width: 40%;">@Html.DisplayNameFor(model => firstOrDefault.RequestDate) </th>
                                </tr>
                                @foreach (var item in Model.AccReqList)
                                {
                                    <tr>
                                        <td>@item.Entity.Name</td>
                                        <td>@item.RequestDate</td>   
                                    </tr>
                                }        
                            </table>
                        }
                    }
                    else
                    {
                        <div class="alert alert-warning">
                            Não existe nenhum pedido de acreditação pendente.
                        </div>                  
                    }     
                </div>
            </div>
        </div>

        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseFour">
                    <i class="icon-user icon-white"></i> <b> Utilizadores Online</b> <span class="label label-info" style="float: right;">&nbsp; 1 &nbsp;</span>
                </a>
            </div>
            <div id="collapseFour" class="accordion-body collapse">
                <div class="accordion-inner">
                    <table id="usersLog" class="table table-hover table-striped table-bordered" style="width:100%; font-size: 12px !important;">
                        <tr>
                            <th>Utilizador</th>
                            <th>Data/Hora Login</th>
                            @*<th></th>*@
                        </tr>
                        <tr>
                            <td>@WebSecurity.CurrentUserName</td>
                            <td>@DateTime.Now</td>
                            @*<td><a href="#" class="btn btn-danger btn-mini" ><i class="icon-off icon-white"></i></a></td>*@
                        </tr>
                    </table>

                </div>
            </div>
        </div>
    </div>
    </div>
</div>


    
